#include <cstdio>
#include <vector>

int const maxn = 300007;
char s[maxn];
int n, m;
int ans;

int main()
{
	std::scanf("%d %d", &n, &m);
	std::scanf("%s", s);
	for (int i = 0; i < n; ) {
		for (; i < n && s[i] != '.'; i++);
		int count = 0;
		for (; i < n && s[i] == '.'; i++, count++);
		if (count) ans += count - 1;
	}

	for (int i = 0; i < m; i++) {
		int x; char ch;
		std::scanf("%d %c", &x, &ch);
		x--;
		if (ch == '.' && s[x] != '.') {
			if (x && s[x-1] == '.') ans++;
			if (x < n-1 && s[x + 1] == '.') ans++;
		} else
		if (ch != '.' && s[x] == '.') {
			if (x && s[x-1] == '.') ans--;
			if (x < n-1 && s[x + 1] == '.') ans--;
		}
		s[x] = ch;
		std::printf("%d\n", ans);
	}
}

